package com.dinzeer.slashblade_project_slr.item;

import cn.mmf.energyblade.energy.FECapabilityProvider;
import cn.mmf.energyblade.item.ItemFEBlade;

import com.dinzeer.legendreliclib.lib.util.text.AdvancedGradientTextHelper;
import com.dinzeer.legendreliclib.lib.util.text.ColorPreset;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Tier;
import net.minecraftforge.common.capabilities.ICapabilityProvider;

import javax.annotation.Nullable;

public class ItemSLRSlashBlade extends ItemFEBlade {
    public ItemSLRSlashBlade(Tier tier, Properties builder) {
        super(tier, 10, 4, builder);
    }
    @Override
    public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) {
        super.initCapabilities(stack, nbt);
        return new FECapabilityProvider(stack, 0, 5000000, 200, 100, false);
    }

    @Override
    public Component getName(ItemStack stack) {
        String originalName = super.getName(stack).getString();

        if (originalName.equals( Component.translatable("item.slashblade_project_slr.slr_001").getString())){
            return AdvancedGradientTextHelper.createGradientText(originalName,
                    ColorPreset.BLUE_ICE,
                    AdvancedGradientTextHelper.GradientMode.FLOW);
        }
        if (originalName.equals( Component.translatable("item.slashblade_project_slr.slr_002").getString())){
            return AdvancedGradientTextHelper.createGradientText(originalName,
                    ColorPreset.RED_EMBER,
                    AdvancedGradientTextHelper.GradientMode.WAVE);
        }
        if (originalName.equals( Component.translatable("item.slashblade_project_slr.slr_003").getString())){
            return AdvancedGradientTextHelper.createGradientText(originalName,
                    ColorPreset.ORANGE_FIRE,
                    AdvancedGradientTextHelper.GradientMode.WAVE);
        }
        if (originalName.equals( Component.translatable("item.slashblade_project_slr.slr_004").getString())){
            return AdvancedGradientTextHelper.createGradientText(originalName,
                    ColorPreset.GREEN_FOREST,
                    AdvancedGradientTextHelper.GradientMode.FLOW);
        }
        if (originalName.equals( Component.translatable("item.slashblade_project_slr.slr_005").getString())){
            return AdvancedGradientTextHelper.createGradientText(originalName,
                    ColorPreset.GOLDEN_SUN,
                    AdvancedGradientTextHelper.GradientMode.WAVE);
        }

        if (originalName.equals( Component.translatable("item.slashblade_project_slr.slr_006").getString())){
            return AdvancedGradientTextHelper.createGradientText(originalName,
                    ColorPreset.PURPLE_MYSTIC,
                    AdvancedGradientTextHelper.GradientMode.FLOW);
        }

        return AdvancedGradientTextHelper.createGradientText(originalName,
                ColorPreset.MINIMALIST_GRAY,
                AdvancedGradientTextHelper.GradientMode.FLOW);
    }


}
